package transaction;

import java.util.ArrayList;
import java.util.List;

import ssb.SSBManager;
import ssbService.AdapterRequest;
import ssbService.Message;


import wrapper.RequestConstructor;


public class TransectionManager {
	private PrepareState prepState;
	private ReadyState readyState;
	private SucessState sucessState;
	private FailureState failureState;
	
	private TransectionState state;
	
	private Message res;
	private List<AdapterRequest> list=new ArrayList<AdapterRequest>();
	
	public TransectionManager() {
		super();
		prepState=new PrepareState(this);
		readyState=new ReadyState(this);
		sucessState=new SucessState(this);
		failureState=new FailureState(this);
		
		state=prepState;
	}
	
	public void setState (TransectionState state){
		this.state=state;
	}
	
	public PrepareState getPrepState() {
		return prepState;
	}

	public ReadyState getReadyState() {
		return readyState;
	}


	public SucessState getSucessState() {
		return sucessState;
	}

	public FailureState getFailureState() {
		return failureState;
	}

	public void addPrep(RequestConstructor req){
		state.addPrep(req);
	}
	
	public boolean commit() {
		// TODO Auto-generated method stub
		return false;
	}

	public boolean execute() {
		// TODO Auto-generated method stub
		return false;
	}

	public boolean payBack() {
		// TODO Auto-generated method stub
		return false;
	}

	public boolean preExec() {
		// TODO Auto-generated method stub
		return false;
	}
}
